﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<QianBuo.Lottery.Web.Models.Play.PlayTypeModel>" %>

<div id='div_Rdo' align="center">
    <input type="radio" name='rdo' id='rdo1' surl='<%=Url.RouteUrl("Play_Single",new{p1=Code.Models.PlayType_E.QianSanZuHe}) %>' value='<%=(short)Code.Models.PlayType_E.QianSanZuHe %>'/><label for='rdo1'>前三组和</label>
    <input type="radio" name='rdo' id='rdo2' surl='<%=Url.RouteUrl("Play_Single",new{p1=Code.Models.PlayType_E.HouSanZuHe}) %>' value='<%=(short)Code.Models.PlayType_E.HouSanZuHe %>' /><label for='rdo2'>后三组和</label>
</div>
<%Html.RenderPartial("ZuHe", Model); %>
<script type="text/javascript">
    var playTypeID = '<%=Model.ID %>';
    var isSingle=<%="true".Equals(TempData["singleplay"] as string)?"true":"false" %>;
    $("#div_Rdo input").each(function () {
        var rdo = $(this);
        rdo.click(function () {
            if (playTypeID == rdo.val())
                return;
            if(isSingle){
                location.href=rdo.attr('surl');
                return;
            }
            var url='<%=Url.Action("Play",new {p1="!"}) %>/'.replace("!",rdo.val());
            $("#play_bet_bar").block({ message: "<img src='<%=Url.Content("~/Content/images/busy.gif") %>'/>载入中..." });
            $("#play_bet_bar").load(url, null, function (p, e, i) {
                $("#play_bet_bar").unblock();
                var doc=$(p);
                if (e == 'success' && doc.length && doc.is("#play_inputpanel")) {
                } else {
                    $("#div_Rdo #rdo" + playTypeID).click()
                    return false;
                }
            });
        });
        if (rdo.val() == playTypeID) {
            this.checked = true;
        }
    });
</script>


